package com.ddzh.service;

import com.ddzh.mapper.OrderMapper;
import com.ddzh.pojo.Order;
import com.ddzh.vo.UserOrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OrderService {

    @Autowired
    private OrderMapper orderMapper;

    /**
     * 返回信息：用户名 订单信息
     * 根据用户名 查询 用户名和 订单详情
     * @param username
     * @return 订单集合
     */
    public List findOrderByUserId(String username){
        List<Order> orderList = orderMapper.findOrderByUserId(username);
//        //用Map集合存放 最终返回结果
//        Map<String, List> userOrderMap = new HashMap<>();
//        userOrderMap.put(username,userOrderVoList);
        return orderList;
    }
}
